package chapter1;
class Student5{
    String name;// 定义name属性
    int age;// 定义age属性
    static String school = "A大学";// 定义school属性
    public Student5(String name, int age){
        this.name = name;
        this.age = age;
    }
    public void info(){
        System.out.println("姓名："+this.name+",年龄："+this.age+",学校："+ school);
    }
}
public class Example14 {
    public static void main(String[] args) {
        Student5 stu1 = new Student5("张三",18);// 创建学生对象
        Student5 stu2 = new Student5("李四",19);
        Student5 stu3 = new Student5("王五",20);
        stu1.info();
        stu2.info();
        stu3.info();
        stu1.school = "B大学";
        stu1.info();
        stu2.info();
        stu3.info();
    }
}
